using System;
using System.Collections.Generic;
using System.Text;
using SwinMessengerLibrary;

namespace SwinMessengerConsoleApp
{
    class QuitCommand: SwinMessengerCommand
    {
        /// <summary>
        /// This is the quit command, it allows a user to log off the server
        /// </summary>
        public QuitCommand()
            : base(new string[] { "quit", "logout"})
        {
        }
        /// <summary>
        /// This executes the quit command
        /// </summary>
        /// <param name="runOn">The server to run the quit command on</param>
        /// <param name="parameters">the parameters of the quit command</param>
        /// <returns>what the quit command will print to the scrren</returns>
        public override List<string> Execute(Server runOn, string[] parameters)
        {
            List<string> tempList = new List<string>();

            runOn.Logout(true);
            tempList.Add("Good Bye");
            return tempList;
        }
    }
}
